package net.mymilkedeek.ludum.tinythumb.states;

import net.mymilkedeek.ludum.tinythumb.Game;
import org.newdawn.slick.*;
import org.newdawn.slick.state.BasicGameState;
import org.newdawn.slick.state.StateBasedGame;

/**
 * TODO: Write Documentation
 *
 * @author Michael Demey
 */
public class GameOver extends BasicGameState {
    @Override
    public int getID() {
        return Game.S_GAMEOVER;
    }

    private Image bG;

    @Override
    public void init(GameContainer gameContainer, StateBasedGame stateBasedGame) throws SlickException {
        bG = new Image("/resources/spritesheets/gameover.png");
    }

    @Override
    public void render(GameContainer gameContainer, StateBasedGame stateBasedGame, Graphics graphics) throws SlickException {
        bG.draw(0,0);
    }

    @Override
    public void update(GameContainer gameContainer, StateBasedGame stateBasedGame, int i) throws SlickException {
        Input input = gameContainer.getInput();
        
        if ( input.isKeyPressed(Input.KEY_SPACE)) {
            gameContainer.reinit();
        }
    }
}
